add custom rector rule to cleanup RouteBuilder#341
Closed
Conversation
826e9cd to
6a4bb79
Compare
Contributor
Author
|
To not make the configuration too complicated i just hard coded the scope specific logic in that rule |
markstory
reviewed
Oct 14, 2025
tests/test_apps/upgraded/RectorCommand-testApply53/src/SomeTest.php
Outdated
Show resolved
Hide resolved
tests/test_apps/upgraded/RectorCommand-testApply53/src/SomeTest.php
Outdated
Show resolved
Hide resolved
ADmad
reviewed
Oct 14, 2025
| $routes->scope('/api', function (RouteBuilder $routes): void {}); | ||
| CODE_SAMPLE, | ||
| <<<'CODE_SAMPLE' | ||
| $routes->scope(path: '/api', options: [], callback: function (RouteBuilder $routes): void {}); |
Member
There was a problem hiding this comment.
I don't like the reaming of $params to $options, we use the term "route params".
We need to first update the method and make $params argument default to empty array and make $callable not nullable.
Contributor
Author
There was a problem hiding this comment.
I'll leave those changes to the the core to you @ADmad
Member
There was a problem hiding this comment.
It seems only resources() should be $options.
6a4bb79 to
233bb80
Compare
3 tasks
Member
|
Do you think #367 is complete? |
8d60f3c to
c3280a4
Compare
Contributor
Author
|
superseded by #367 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs: cakephp/cakephp#18002
There is still one problem though which I have not yet tackled:
does not work, as
paramsneeds to be set as an empty array (which we don't have as a default value only on that method, not the others)